import axios from "axios";
const instance = axios.create({
  baseURL: "http://192.168.2.135:8081/src/mock/",
  timeout: 5000,
  headers: { "Content-Type": "application/json" },  
});

instance.interceptors.request.use(
  (config) => {
    return config;
  },
  (error) => {
    return Promise.reject(error);
  }
);
instance.interceptors.response.use(
  (response) => {
    return response.data;
  },
  (error) => {
    return Promise.reject(error);
  }
);

export default {
    get(url, params) {
      return instance.get(url, { params });
    },
    post(url, data) {
      return instance.post(url, data);
    },
};